package org.ruanjj.reverseList;

import org.ruanjj.linkedlist.ListNode;

public class Solution {
    ListNode cur = new ListNode(-1);
    ListNode res = cur;
    public ListNode reverseList(ListNode head) {
        if(head == null){
            return head;
        }
        reverseList(head.next);
        cur.next = head;
        cur = cur.next;
        cur.next = null;
        return res.next;
    }
}
